import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Demo from "@/views/index/index.vue";

const routes: { redirect: { name: string }; path: string; component: any; children: ({ path: string; component: any; meta: { title: string }; name: string } | { path: string; component: () => Promise<any>; meta: { title: string }; name: string } | { path: string; component: () => Promise<any>; meta: { noCache: boolean; title: string }; name: string })[]; name: string }[] = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "Index" },
    children: [
      {
        path: "index",
        name: "Index",
        component: Demo,
        meta: {
          title: "首页"
        }
      },
      {
        path: "count",
        name: "Count",
        component: () => import("@/views/count/index.vue"),
        meta: {
          title: "古德温救我"
        }
      },
      {
        path: "tools",
        name: "Tools",
        component: () => import("@/views/tools/index.vue"),
        meta: {
          title: "工具"
        }
      },
      {
        path: "recharge",
        name: "Recharge",
        component: () => import("@/views/recharge/index.vue"),
        meta: {
          title: "充值"
        }
      },
      {
        path: "purchaseMembership",
        name: "PurchaseMembership",
        component: () => import("@/views/purchaseMembership/index.vue"),
        meta: {
          title: "购买会员"
        }
      },
      {
        path: "feedback",
        name: "Feedback",
        component: () => import("@/views/feedback/index.vue"),
        meta: {
          title: "反馈"
        }
      },
      {
        path: "login",
        name: "Login",
        component: () => import("@/views/login/login.vue"),
        meta: {
          title: "登录"
        }
      },  {
        path: "register",
        name: "Register",
        component: () => import("@/views/register/index.vue"),
        meta: {
          title: "注册"
        }
      },
      {
        path: "about",
        name: "About",
        component: () => import("@/views/about/index.vue"),
        meta: {
          title: "关于",
          noCache: true
        }
      },
      {
        path: "chatRoom",
        name: "ChatRoom",
        component: () => import("@/views/chatRoom/index.vue"),
        meta: {
          title: "聊天室",
          noCache: true
        }
      },
      {
        path: "vipChat",
        name: "VipChat",
        component: () => import("@/views/vipChat/index.vue"),
        meta: {
          title: "聊天室",
          noCache: true
        }
      }
    ]
  }
];

export default routes;
